/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.hd4ic.test;

import boofcv.abst.feature.detect.edge.DetectEdgeContour;
import boofcv.alg.feature.detect.intensity.HarrisCornerIntensity;
import boofcv.core.image.ConvertBufferedImage;
import boofcv.core.image.ConvertImage;
import boofcv.factory.feature.detect.edge.FactoryDetectEdgeContour;
import boofcv.factory.feature.detect.intensity.FactoryIntensityPointAlg;
import boofcv.struct.image.*;
import georegression.struct.point.Point2D_I32;

import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.imageio.ImageIO;
import javax.swing.*;

public class Foo001 {


    public static void main(String[] args) throws IOException {

//       FactoryIntensityPointAlg.Harris();
        BufferedImage inputImage = ImageIO.read(new File("test.bmp"));
//       ImageUInt8 gray = ConvertBufferedImage.convertFrom(inputImage, (ImageUInt8) null);
        ImageUInt8 gray = ConvertBufferedImage.convertFromSingle(inputImage, null, ImageUInt8.class);
        ImageSInt16 test = new ImageSInt16(inputImage.getWidth(), inputImage.getHeight());
        ConvertImage.convert(gray, test);

        HarrisCornerIntensity<ImageSInt16> harrisCornerIntensity=
                FactoryIntensityPointAlg.harris(10,0.4f,true,ImageSInt16.class);

        ImageFloat32 output=new ImageFloat32(inputImage.getWidth(),inputImage.getHeight());

        harrisCornerIntensity.process(test,test,output);



//        harrisCornerIntensity.process();

//       int threshold=122;
//       DetectEdgeContour<ImageUInt8> simple =
//               FactoryDetectEdgeContour.binarySimple(threshold, true);
//       simple.process(gray);
//       List<List<Point2D_I32>> edges = simple.getContours();
//       BufferedImage output = new BufferedImage(gray.width, gray.height, BufferedImage.TYPE_BYTE_GRAY);


    }
}
